Conversation
|
Whoever you are, I just want to thank you as a CSSE 2 student this year for writing this movement logic. Wish I could say more, but thank you :) Have a great day :D |
Author
No problem, I honestly didn't get to finish some of the collision to make it completely work. If you need any help with it I'll be here. Have a better day :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the code for playerBase.js, look for case 'jump', and look for the line of code that specifies " this.yv = this.bottom * -0.04; " this line is in charge of gravity. if the number is closer to zero the gravity decreases, and farther away from zero the gravity increases. (the number has to be negative, otherwise he'll jump into the ground.) This would be good to change for a level with a different gravity than normal.
In the code for character.js, look for updateY under YCol, and look for the line that specifies " this.yv += GameEnv.gravity; " this line is in charge of the speed of the fall increasing as the character falls.
Each level has custom player controls, so for each level, I had to incorporate the new movement into every single file. This includes updating the
jumpHeightFactorby dividing it by 10 so that when bouncing on the goombas the player doesn't shoot up. The code works but needs to be improved with collisions but the collision will deal with it and fix the issue. Besides that there is very rudimentary collision code that barely works but can stand by itself if the collison team doesn't figure out a solution to that issue.